package com.googlecode.cnasort.cc.rmi.server.ihm;

import java.net.InetAddress;
import com.googlecode.cnasort.cc.rmi.server.MyRmiServer;
import com.googlecode.cnasort.cc.rmi.server.core.Message;

public class ServerCommand
{
    //private static final Logger logger = Logger.getLogger( ServerCommand.class );
    private Message message;

    public ServerCommand()
    {
    }

    public void setMessage( Message message )
    {
        this.message = message;
        //this.server  = new ExoRmiServer( message );
    }

    public void lauch(InetAddress inetAddress)
    {
        String serverName = inetAddress.getHostAddress();

        MyRmiServer.start( message, serverName );
                //new MyRmiServer( message );//.exportObject( new ComputeEngine(), Compute.SERVICE_NAME );
//        try {
//            // this.server.startServer( serverName );
//            this.server = new MyRmiServer( message );//.exportObject( new ComputeEngine(), Compute.SERVICE_NAME );
//            }
//        catch (IOException e) {
//            logger.fatal( "startServer(" + serverName + ')' );
//
//            message.warn( "Can't start server: " + serverName );
//        }
    }
}
